#include <iostream>

class B {
    int n;
public:
    B(int x) : n(x) {}
    int set() { return n + 2; }
    void show() { std::cout << n << " "; }
};

class A : public B {
    int m;
public:
    A(int x, int y) : B(x), m(y) {}
    int set() { return B::set() + 2; }
    void show() { B::show(); std::cout << " " << m; }
};

void f(B* q) {
    std::cout << q->set();
    int QQ;
}

int test23_c_06() {
    A d1(2, 3);
    B d2(4);

    f(&d1);
    return 0;
}
